import 'package:baselib/utils/image_util.dart';
import 'package:baselib/widgets/nosize_app_bar.dart';
import 'package:flutter/material.dart';
import 'package:framelib/utils/color_util.dart';
import 'package:framelib/utils/drawable_util.dart';
import 'package:framelib/utils/px_util.dart';
import 'package:framelib/widgets/comm_widget_manager.dart';
import 'package:framelib/widgets/page_widget.dart';
import 'package:get/get.dart';
import 'package:module_business/module_comm/viewmodel/splash_view_model.dart';
import 'package:flustars_flutter3/flustars_flutter3.dart';
class SplashPage extends GetWidget<SplashViewModel> {
  @override
  Widget build(BuildContext context) {
    var size2 = MediaQuery.of(context).size;
    //设置字体大小根据系统的“字体大小”辅助选项来进行缩放,默认为false
    setDesignWHD(size2.width,size2.height, density: 3);
    // setDesignWHD(375,812, density: 0);
    return PageWidget.build(
      builder: (SplashViewModel model){
        return PageWidget.PageScaffoldWidget(
          // appBar: NoSizeAppBar(
          //   backgroundColor: ColorUtil.instance.color_white,
          // ),
          isShowBg: true,
          body: FadeTransition(//透明度动画组件
            opacity: model.animation, //动画
            child: Container(
                color: ColorUtil.instance.color_transparent,
                width: PxUtil.instance.screenWidth,
                height: PxUtil.instance.screenHeight,
                alignment: Alignment.center,
                child: Column(
                  mainAxisSize: MainAxisSize.max,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Container(
                            width: PxUtil.instance.screenWidth*2/5,
                            height: PxUtil.instance.screenWidth*2/5,
                            alignment: Alignment.center,
                            decoration: BoxDecoration(
                                gradient: LinearGradient(
                                    begin: Alignment.topCenter,
                                    end: Alignment.bottomCenter,
                                    colors: [
                                      ColorUtil.instance.color_AE2CF1,
                                      ColorUtil.instance.color_7776FF,
                                    ]),
                                borderRadius: BorderRadius.circular(PxUtil.instance.screenWidth*2/10)
                            ),
                            child: ImagesUtil.loadAssetImage(
                                DrawableUtil.instance.icon_splash_login,
                                height: PxUtil.instance.px_30,
                                fit: BoxFit.fitHeight
                            )
                        )
                      ],
                    ),
                    Container(
                      margin: EdgeInsets.only(
                          top: PxUtil.instance.screenHeight/10,
                          bottom: PxUtil.instance.screenHeight/8,
                      ),
                      child: ImagesUtil.loadAssetImage(
                        DrawableUtil.instance.Interest_Voice_Group_Voice_Chat,
                        width: PxUtil.instance.screenWidth*6/8,
                        fit: BoxFit.fitWidth
                      ),
                    )
                  ],
                )
            ),
          ),
        );
      }
    );
  }
}
